/**
* Created by leiweibo on 4/7/15.
*/
'use strict'

var app = angular.module('vistrackDirectives', []);

app.directive('stRatio', function() {
    return {
      link: function(scope, element, attr) {
        var ratio =+(attr.stRatio);

        element.css('width', ratio + '%');
      }
    }
  })
  .directive('pageSelect', function() {
    return {
      restrict: 'E',
      template: '<input type="text" class="select-page" ng-model="inputPage" ng-change="selectPage(inputPage)">',
      link: function(scope, element, attrs) {
        scope.$watch('currentPage', function(c) {
          scope.inputPage = c;
        });
      }
    }
  })
  .directive('stAlignCenter', function() {
    return {
      link: function(scope, element, attr) {
        element.css('text-align', 'center');
      }
    }
  });;